<?php
require_once('../../config.php');
Doctrine::loadModels('../../models');

if( $_REQUEST["agent_id"])
{
	$checklist = new AgentChecklist();
	
	$checklist->agent_id = strip_tags($_REQUEST["agent_id"]);
	$checklist->checklist_item_id = strip_tags($_REQUEST["checklist_item_id"]);
	$checklist->status_id = strip_tags($_REQUEST["status_id"]);
	$checklist->created = date("Y-m-d H:m:s");
	$checklist->modified = date("Y-m-d H:m:s");
	//$checklist->created_by = $created_by;
	//$checklist->modified_by = $modified_by;	
	$address->deleted = 0;	

	$checklist->save();
	
	$checklistID = $checklist->checklist_id;	
	
	$dom = new DomDocument('1.0');
	$dom->formatOutput = true;
	
	$root = $dom->createElement( "results" );
	$dom->appendChild( $root );
			$dn = $dom->createElement( "record" );
			$dn->setAttribute( 'checklistID', $checklistID );
			$root->appendChild( $dn );	
	
	header( "Content-type: text/xml");
	echo $dom->saveXML();

}

?>